package cn.meike.server;

public class ModelManager
{
	public static final int MODEL_TYPE_LOGIN = 0;
	public static final int MODEL_TYPE_PLAYER = 1;

	private static ModelManager m_instance = null;
	
	private LoginModel m_loginModel = null;
	private PlayerModel m_playerModel = null;
	
	private ModelManager()
	{
		m_loginModel = new LoginModel();
		m_playerModel = new PlayerModel();
	}

	public static ModelManager getInstance()
	{
		if(m_instance == null)
		{
			m_instance = new ModelManager();
		}
		
		return m_instance;
	}
	
	
	public IModel getModel(int type)
	{
		IModel _model = null;
		
		switch(type)
		{
			case MODEL_TYPE_LOGIN:
				_model = m_loginModel;
				break;
			case MODEL_TYPE_PLAYER:
				_model = m_playerModel;
				break;
			default:
				break;
		}
		
		return _model ;
	}


}